#include <stdint.h>
#include "stdio.h"

#ifndef TMC2209_H
#define TMC2209_H

// TMC2209寄存器地址
#define TMC2209_REG_DRV_STATUS     0x00
#define TMC2209_REG_CHOPCONF       0x0D
#define TMC2209_REG_SMARTEN        0x0C
#define TMC2209_REG_SGCSCONF       0x0E
#define TMC2209_REG_GLOBAL_SCALER  0x0A

class TMC2209
{
public:
	void write_register(uint8_t address, uint32_t config);
	TMC2209(UART_HandleTypeDef *_p_uart2);
	int check_stallGuard();
	uint32_t read_register(UART_HandleTypeDef *huart, uint8_t address);
private:

	UART_HandleTypeDef *p_uart2;


};
#endif
